# -*- coding:utf-8 -*-
# @FileName  :per_special_access.py
# @Time      :2020/12/11 11:39
# @Author    :Zhoujirong
# @Desc      :
from common.http_request import Request
from biz.support.urls import ServerUrl
class PerSpecialAccessRequest:
    @classmethod
    def check_user(cls,userName,cookie):
        data = {
        'userName':userName
        }
        req = Request(ServerUrl.per_special_access_check_user_url,data=data,headers=cookie)
        return req.post()

    @classmethod
    def create(cls,userAuthorized,
                    deptName,
                    orgId,
                    beginTimeAuthorized,
                    endTimeAuthorized,
                    qryReason,
                    authorizeType,cookie):
        data = {
                'userAuthorized':userAuthorized,
                'deptName':deptName,
                'orgId':orgId,
                'beginTimeAuthorized':beginTimeAuthorized,
                'endTimeAuthorized':endTimeAuthorized,
                'qryReason':qryReason,
                'authorizeType':authorizeType
        }
        req = Request(ServerUrl.per_special_access_create_url,data=data,headers=cookie)
        return req.post()

    @classmethod
    def get_page(cls,curPage,
                    maxSize,
                    search_LIKE_userAuthorized,
                    search_IN_orgId,
                    search_GTE_beginTimeAuthorized_DATE,
                    search_LTE_endTimeAuthorized_DATE,
                    search_LIKE_qryReason,
                    search_LIKE_operator,
                    search_LIKE_authorizeType,cookie):
        data = {
            'curPage':curPage,
            'maxSize':maxSize,
            'search_LIKE_userAuthorized':search_LIKE_userAuthorized,
            'search_IN_orgId':search_IN_orgId,
            'search_GTE_beginTimeAuthorized_DATE':search_GTE_beginTimeAuthorized_DATE,
            'search_LTE_endTimeAuthorized_DATE':search_LTE_endTimeAuthorized_DATE,
            'search_LIKE_qryReason':search_LIKE_qryReason,
            'search_LIKE_operator':search_LIKE_operator,
            'search_LIKE_authorizeType':search_LIKE_authorizeType
        }
        req = Request(ServerUrl.per_special_access_getpage_url,params=data,headers=cookie)
        return req.get()

    @classmethod
    def stop(cls,id,cookie):
        data = {
         'id':id
        }
        req = Request(ServerUrl.per_special_access_stop_url,params=data,headers=cookie)
        return req.post()





if __name__ == "__main__":
    pass